package com.cms.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.cms.model.dto.ResourceMenuDto;
import com.cms.model.vo.SysResource;

import tk.mybatis.mapper.common.Mapper;

public interface SysResourceDao extends Mapper<SysResource>{
	
	List<SysResource> selectResourceList(SysResource resource);

	List<SysResource> selectResUrlAllList();

	List<SysResource> selectResourceAllList();
	
	List<ResourceMenuDto> selectParentIdResList(@Param("roleIds") Integer[] roleIds);
	
	Long selectCountResParentByResId(@Param("resId") Integer resId);
	
	List<SysResource> selectResListByUserId(@Param("userId") Integer userId);

	List<SysResource> selectResLevelListByParentId(@Param("roleIds") Integer[] roleIds,@Param("parentId") Integer parentId);

	List<SysResource> selectParentResListByResTypeAndResLevel(@Param("resType") Integer resType,
			@Param("resLevel") Integer resLevel,@Param("resId") Integer resId);

	void updateMenuByStatus(Map<String, Object> params);

	@Select("select res_id from sys_resource where res_parentId in (${resIds})")
	List<String> selectSubIdByResId(@Param("resIds") String resIds);
}
